/*
 * Copyright (C) 2010 Imavis Srl
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.imavis.avimuxer;

/**
 *
 * @author Aldo Brucale
 */
final class ResolutionPolicy {
    private static final ResolutionPolicy NOT_SET = new ResolutionPolicy(1, 1);
    private static ResolutionPolicy PARSED = new ResolutionPolicy(1, 1);
    private int width;
    private int height;

    public static ResolutionPolicy fixed(int width, int height) {
        return new ResolutionPolicy(width, height);
    }

    /**
     * Returns a placeholder used to indicate that resolution has not yet been set
     */
    public static ResolutionPolicy notSet() {
        return NOT_SET;
    }

    /**
     * Returns a placeholder used to indicate that resolution should be parsed
     */
    public static ResolutionPolicy parsed() {
        return PARSED;
    }

    private ResolutionPolicy(int width, int height) {
        if (width <= 0 || height <= 0) {
            throw new IllegalArgumentException(
                    "Width and height must be positive");
        }
        this.width = width;
        this.height = height;
    }

    public int getHeight() {
        return height;
    }

    public int getWidth() {
        return width;
    }
}
